package com.cjx.leetcode.greedy;

import java.util.Arrays;

/**
 * @author cjx
 * @description E455.分发饼干【简】
 * @createDate 2024/4/10 11:04
 **/
public class E455 {
    public int findContentChildren(int[] g, int[] s) {
        Arrays.sort(g);
        Arrays.sort(s);
        int res = 0;
        for (int i = 0, j = 0; i < s.length && j < g.length; i++) {
            if (s[i] >= g[j]){
                res += 1;
                j++;
            }
        }
        return res;
    }
}
